package com.forlove.app.qselect.hotlist.ui;

import android.graphics.Color;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.support.v7.widget.Toolbar;
import android.view.View;
import android.widget.RelativeLayout;

import com.forlove.app.R;
import com.forlove.app.common.base.ui.BaseActivity;
import com.forlove.app.common.utils.StatusBarCompat;
import com.forlove.app.qselect.hotlist.adapter.HotlistDetailAdapter;
import com.forlove.app.qselect.hotlist.entity.HotCircleEntity;

import java.util.ArrayList;

import butterknife.BindView;

/**
 * 达人榜详情
 * Created by yjl on 2017/10/15.
 */

public class HotlistDetailActivity extends BaseActivity {

    @BindView(R.id.list_hotlist_detail)
    RecyclerView list_hotlist_detail;

    @BindView(R.id.hotlist_detail_toolbar)
    Toolbar toolbar;

    @BindView(R.id.view_question)
    RelativeLayout detailQuestion;

    private ArrayList<HotCircleEntity> hotCircleEntities = new ArrayList<>();
    private HotlistDetailAdapter hotlistDetailAdapter;

    @Override
    public int getLayoutId() {
        return R.layout.activity_hotlist_detail;
    }

    @Override
    public void initView() {
        initToolBar();
        initRecyclerView();
    }

    @Override
    protected void onResume() {
        super.onResume();
        StatusBarCompat.compat(this, Color.parseColor("#7a8df6"));
    }

    private void initToolBar() {
        detailQuestion.setBackgroundColor(Color.parseColor("#7a8df6"));

        showToolBar(this, toolbar, R.mipmap.ic_back_nor, new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                onBackPressed();
            }
        }, null);
        StatusBarCompat.compat(this, Color.parseColor("#7a8df6"));

    }

    private void initRecyclerView() {
        HotCircleEntity hotCircleEntity = new HotCircleEntity();
        hotCircleEntities.add(hotCircleEntity);
        hotCircleEntities.add(hotCircleEntity);
        hotCircleEntities.add(hotCircleEntity);
        hotCircleEntities.add(hotCircleEntity);
        hotCircleEntities.add(hotCircleEntity);
        hotCircleEntities.add(hotCircleEntity);
        hotCircleEntities.add(hotCircleEntity);
        hotCircleEntities.add(hotCircleEntity);
        hotCircleEntities.add(hotCircleEntity);
        hotCircleEntities.add(hotCircleEntity);
        hotCircleEntities.add(hotCircleEntity);
        hotCircleEntities.add(hotCircleEntity);
        hotCircleEntities.add(hotCircleEntity);

        hotlistDetailAdapter = new HotlistDetailAdapter(this, R.layout.item_detail_hotlist, hotCircleEntities);
        LinearLayoutManager linearLayoutManager = new LinearLayoutManager(this);
        list_hotlist_detail.setLayoutManager(linearLayoutManager);
        list_hotlist_detail.setAdapter(hotlistDetailAdapter);

    }
}
